function Headline(params){ 
	 
}

Headline.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new Headline.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new Headline.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new Headline.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	/** 编号 [非空]       **/
	this.id=function(id){if(this.proxy)return this.getProxy().id(id);  this.put("id", id);return this;};
	/** and id is null */
	this.idNull=function(){if(this.proxy)return this.getProxy().idNull();if(this.get("idNot")==null)this.put("idNot", "");this.put("id", null);return this;};
	/** not .... */
	this.idNot=function(){if(this.proxy)return this.getProxy().idNot();this.put("idNot", "not");return this;};
	this.idNotNull=function(){if(this.proxy)return this.getProxy().idNotNull();this.put("idNot", "not");this.put("id", null);return this;};
	this.idNot=function(id){if(this.proxy)return this.getProxy().idNot(id);this.put("idNot", "not");this.put("id", id);return this;};
	/** and id <= ? */
	this.idMin=function(min){if(this.proxy)return this.getProxy().idMin(min);this.put("idMin", min);return this;};
	/** and id >= ? */
	this.idMax=function(max){if(this.proxy)return this.getProxy().idMax(max);this.put("idMax", max);return this;};
	this.idIn=function(ids){
		if(this.proxy)return this.getProxy().idIn(ids);  this.put("idIn", ids);return this;
	};	
	
	/** 所属品牌  [Merchant]      **/
	this.merchant=function(merchant){if(this.proxy)return this.getProxy().merchant(merchant);  this.put("merchant", merchant);return this;};
	/** and merchant is null */
	this.merchantNull=function(){if(this.proxy)return this.getProxy().merchantNull();if(this.get("merchantNot")==null)this.put("merchantNot", "");this.put("merchant", null);return this;};
	/** not .... */
	this.merchantNot=function(){if(this.proxy)return this.getProxy().merchantNot();this.put("merchantNot", "not");return this;};
	this.merchantNotNull=function(){if(this.proxy)return this.getProxy().merchantNotNull();this.put("merchantNot", "not");this.put("merchant", null);return this;};
	this.merchantNot=function(merchant){if(this.proxy)return this.getProxy().merchantNot(merchant);this.put("merchantNot", "not");this.put("merchant", merchant);return this;};
	this.merchantIn=function(ids){
		if(this.proxy)return this.getProxy().merchantIn(ids);  this.put("merchantIn", ids);return this;
	};	
	
	/** 文章标题 [非空]       **/
	this.title=function(title){if(this.proxy)return this.getProxy().title(title);  this.put("title", title);return this;};
	/** and title is null */
	this.titleNull=function(){if(this.proxy)return this.getProxy().titleNull();if(this.get("titleNot")==null)this.put("titleNot", "");this.put("title", null);return this;};
	/** not .... */
	this.titleNot=function(){if(this.proxy)return this.getProxy().titleNot();this.put("titleNot", "not");return this;};
	this.titleNotNull=function(){if(this.proxy)return this.getProxy().titleNotNull();this.put("titleNot", "not");this.put("title", null);return this;};
	this.titleNot=function(title){if(this.proxy)return this.getProxy().titleNot(title);this.put("titleNot", "not");this.put("title", title);return this;};
	
	/** 列表图 [非空]       **/
	this.images=function(images){if(this.proxy)return this.getProxy().images(images);  this.put("images", images);return this;};
	/** and images is null */
	this.imagesNull=function(){if(this.proxy)return this.getProxy().imagesNull();if(this.get("imagesNot")==null)this.put("imagesNot", "");this.put("images", null);return this;};
	/** not .... */
	this.imagesNot=function(){if(this.proxy)return this.getProxy().imagesNot();this.put("imagesNot", "not");return this;};
	this.imagesNotNull=function(){if(this.proxy)return this.getProxy().imagesNotNull();this.put("imagesNot", "not");this.put("images", null);return this;};
	this.imagesNot=function(images){if(this.proxy)return this.getProxy().imagesNot(images);this.put("imagesNot", "not");this.put("images", images);return this;};
	
	/** 正文 [非空]       **/
	this.content=function(content){if(this.proxy)return this.getProxy().content(content);  this.put("content", content);return this;};
	/** and content is null */
	this.contentNull=function(){if(this.proxy)return this.getProxy().contentNull();if(this.get("contentNot")==null)this.put("contentNot", "");this.put("content", null);return this;};
	/** not .... */
	this.contentNot=function(){if(this.proxy)return this.getProxy().contentNot();this.put("contentNot", "not");return this;};
	this.contentNotNull=function(){if(this.proxy)return this.getProxy().contentNotNull();this.put("contentNot", "not");this.put("content", null);return this;};
	this.contentNot=function(content){if(this.proxy)return this.getProxy().contentNot(content);this.put("contentNot", "not");this.put("content", content);return this;};
	
	/** 排序        **/
	this.hSort=function(hSort){if(this.proxy)return this.getProxy().hSort(hSort);  this.put("hSort", hSort);return this;};
	/** and h_sort is null */
	this.hSortNull=function(){if(this.proxy)return this.getProxy().hSortNull();if(this.get("hSortNot")==null)this.put("hSortNot", "");this.put("hSort", null);return this;};
	/** not .... */
	this.hSortNot=function(){if(this.proxy)return this.getProxy().hSortNot();this.put("hSortNot", "not");return this;};
	this.hSortNotNull=function(){if(this.proxy)return this.getProxy().hSortNotNull();this.put("hSortNot", "not");this.put("hSort", null);return this;};
	this.hSortNot=function(hSort){if(this.proxy)return this.getProxy().hSortNot(hSort);this.put("hSortNot", "not");this.put("hSort", hSort);return this;};
	/** and h_sort <= ? */
	this.hSortMin=function(min){if(this.proxy)return this.getProxy().hSortMin(min);this.put("hSortMin", min);return this;};
	/** and h_sort >= ? */
	this.hSortMax=function(max){if(this.proxy)return this.getProxy().hSortMax(max);this.put("hSortMax", max);return this;};
	this.hSortIn=function(ids){
		if(this.proxy)return this.getProxy().hSortIn(ids);  this.put("hSortIn", ids);return this;
	};	
	
	/** 来源媒体 [非空]       **/
	this.source=function(source){if(this.proxy)return this.getProxy().source(source);  this.put("source", source);return this;};
	/** and source is null */
	this.sourceNull=function(){if(this.proxy)return this.getProxy().sourceNull();if(this.get("sourceNot")==null)this.put("sourceNot", "");this.put("source", null);return this;};
	/** not .... */
	this.sourceNot=function(){if(this.proxy)return this.getProxy().sourceNot();this.put("sourceNot", "not");return this;};
	this.sourceNotNull=function(){if(this.proxy)return this.getProxy().sourceNotNull();this.put("sourceNot", "not");this.put("source", null);return this;};
	this.sourceNot=function(source){if(this.proxy)return this.getProxy().sourceNot(source);this.put("sourceNot", "not");this.put("source", source);return this;};
	
	/** 是否滚动    0:否 1:是     **/
	this.scroll=function(scroll){if(this.proxy)return this.getProxy().scroll(scroll);  this.put("scroll", scroll);return this;};
	/** and scroll is null */
	this.scrollNull=function(){if(this.proxy)return this.getProxy().scrollNull();if(this.get("scrollNot")==null)this.put("scrollNot", "");this.put("scroll", null);return this;};
	/** not .... */
	this.scrollNot=function(){if(this.proxy)return this.getProxy().scrollNot();this.put("scrollNot", "not");return this;};
	this.scrollNotNull=function(){if(this.proxy)return this.getProxy().scrollNotNull();this.put("scrollNot", "not");this.put("scroll", null);return this;};
	this.scrollNot=function(scroll){if(this.proxy)return this.getProxy().scrollNot(scroll);this.put("scrollNot", "not");this.put("scroll", scroll);return this;};
	this.scrollIn=function(ids){
		if(this.proxy)return this.getProxy().scrollIn(ids);  this.put("scrollIn", ids);return this;
	};	
	
	/** 关联商品  [Commodity]      **/
	this.commod=function(commod){if(this.proxy)return this.getProxy().commod(commod);  this.put("commod", commod);return this;};
	/** and commod is null */
	this.commodNull=function(){if(this.proxy)return this.getProxy().commodNull();if(this.get("commodNot")==null)this.put("commodNot", "");this.put("commod", null);return this;};
	/** not .... */
	this.commodNot=function(){if(this.proxy)return this.getProxy().commodNot();this.put("commodNot", "not");return this;};
	this.commodNotNull=function(){if(this.proxy)return this.getProxy().commodNotNull();this.put("commodNot", "not");this.put("commod", null);return this;};
	this.commodNot=function(commod){if(this.proxy)return this.getProxy().commodNot(commod);this.put("commodNot", "not");this.put("commod", commod);return this;};
	this.commodIn=function(ids){
		if(this.proxy)return this.getProxy().commodIn(ids);  this.put("commodIn", ids);return this;
	};	
	
	/** 相关文章  [Headline]      **/
	this.relatedArticles=function(relatedArticles){if(this.proxy)return this.getProxy().relatedArticles(relatedArticles);  this.put("relatedArticles", relatedArticles);return this;};
	/** and related_articles is null */
	this.relatedArticlesNull=function(){if(this.proxy)return this.getProxy().relatedArticlesNull();if(this.get("relatedArticlesNot")==null)this.put("relatedArticlesNot", "");this.put("relatedArticles", null);return this;};
	/** not .... */
	this.relatedArticlesNot=function(){if(this.proxy)return this.getProxy().relatedArticlesNot();this.put("relatedArticlesNot", "not");return this;};
	this.relatedArticlesNotNull=function(){if(this.proxy)return this.getProxy().relatedArticlesNotNull();this.put("relatedArticlesNot", "not");this.put("relatedArticles", null);return this;};
	this.relatedArticlesNot=function(relatedArticles){if(this.proxy)return this.getProxy().relatedArticlesNot(relatedArticles);this.put("relatedArticlesNot", "not");this.put("relatedArticles", relatedArticles);return this;};
	
	/** 修改时间 [非空]       **/
	this.updateTime=function(updateTime){if(this.proxy)return this.getProxy().updateTime(updateTime);  this.put("updateTime", updateTime);return this;};
	/** and update_time is null */
	this.updateTimeNull=function(){if(this.proxy)return this.getProxy().updateTimeNull();if(this.get("updateTimeNot")==null)this.put("updateTimeNot", "");this.put("updateTime", null);return this;};
	/** not .... */
	this.updateTimeNot=function(){if(this.proxy)return this.getProxy().updateTimeNot();this.put("updateTimeNot", "not");return this;};
	this.updateTimeNotNull=function(){if(this.proxy)return this.getProxy().updateTimeNotNull();this.put("updateTimeNot", "not");this.put("updateTime", null);return this;};
	this.updateTimeNot=function(updateTime){if(this.proxy)return this.getProxy().updateTimeNot(updateTime);this.put("updateTimeNot", "not");this.put("updateTime", updateTime);return this;};
	/** and update_time >= ? */
	this.updateTimeStart=function(start){if(this.proxy)return this.getProxy().updateTimeStart(start);this.put("updateTimeStart", start);return this;};			
	/** and update_time <= ? */
	this.updateTimeEnd=function(end){if(this.proxy)return this.getProxy().updateTimeEnd(end);this.put("updateTimeEnd", end);return this;};
	
	/** 添加时间 [非空]       **/
	this.addTime=function(addTime){if(this.proxy)return this.getProxy().addTime(addTime);  this.put("addTime", addTime);return this;};
	/** and add_time is null */
	this.addTimeNull=function(){if(this.proxy)return this.getProxy().addTimeNull();if(this.get("addTimeNot")==null)this.put("addTimeNot", "");this.put("addTime", null);return this;};
	/** not .... */
	this.addTimeNot=function(){if(this.proxy)return this.getProxy().addTimeNot();this.put("addTimeNot", "not");return this;};
	this.addTimeNotNull=function(){if(this.proxy)return this.getProxy().addTimeNotNull();this.put("addTimeNot", "not");this.put("addTime", null);return this;};
	this.addTimeNot=function(addTime){if(this.proxy)return this.getProxy().addTimeNot(addTime);this.put("addTimeNot", "not");this.put("addTime", addTime);return this;};
	/** and add_time >= ? */
	this.addTimeStart=function(start){if(this.proxy)return this.getProxy().addTimeStart(start);this.put("addTimeStart", start);return this;};			
	/** and add_time <= ? */
	this.addTimeEnd=function(end){if(this.proxy)return this.getProxy().addTimeEnd(end);this.put("addTimeEnd", end);return this;};
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有品牌头条 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/setting/headline.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取品牌头条分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/setting/headline.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取品牌头条 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/setting/headline.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

Headline.get = function(id){
	var protocol = ux.ajax("/admin/setting/headline.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.headline;
	return null;
}

Headline.where = new Headline.Where(0,true);